#include "string.h"
#include <iostream>

const int Arsize = 10;
const int MaxLen = 81;

int main(int argc, char const *argv[])
{
    using std::cout;
    using std::cin;
    using std::endl;

    cout << "name:";
    String name;
    cin >> name;

    String sayings[Arsize];
    char temp[MaxLen];
    int i;
    for(i = 0; i < Arsize; ++i)
    {
        cout << i + 1 << ":";
        cin.get(temp, MaxLen);
        while(cin && cin.get() != '\n') // 消耗多余的字符
            continue;
        if(!cin || temp[0] == '\0') // 读取出错，或者空行
            break;
        else
            sayings[i] = temp;          // 赋值运算符
        
    }
    cout << endl;
    
    int total = i;
    if(total > 0)
    {
        for(i = 0; i < total; ++i)
            cout << sayings[i][0] << ": " << sayings[i] << endl;
        
        int shortest = 0;
        int first = 0;
        for(i = 1; i < total; ++i)
        {
            if(sayings[i] < sayings[first])
                first = i;
        }
        cout << "First Saying: " << sayings[first] << endl;
    }
    else
    cout << "NO INPUT!" << endl;
    
    return 0;
}
